$OpenBSD: patch-lib-src_lua_tolua_map_c,v 1.1 2017/05/04 23:00:16 espie Exp $

Index: lib-src/lua/tolua_map.c
--- lib-src/lua/tolua_map.c.orig
+++ lib-src/lua/tolua_map.c
@@ -25,7 +25,7 @@
 /* Create metatable
 	* Create and register new metatable
 */
-static int tolua_newmetatable (lua_State* L, char* name)
+static int tolua_newmetatable (lua_State* L, const char* name)
 {
 	int r = luaL_newmetatable(L,name);
 
@@ -389,7 +389,7 @@ TOLUA_API int tolua_register_gc (lua_State* L, int lo)
 	* It creates the correspoding metatable in the registry, for both 'type' and 'const type'.
 	* It maps 'const type' as being also a 'type'
 */
-TOLUA_API void tolua_usertype (lua_State* L, char* type)
+TOLUA_API void tolua_usertype (lua_State* L, const char* type)
 {
  char ctype[128] = "const ";
  strncat(ctype,type,120);
@@ -403,7 +403,7 @@ TOLUA_API void tolua_usertype (lua_State* L, char* typ
 /* Begin module
 	* It pushes the module (or class) table on the stack
 */
-TOLUA_API void tolua_beginmodule (lua_State* L, char* name)
+TOLUA_API void tolua_beginmodule (lua_State* L, const char* name)
 {
 	if (name)
 	{
@@ -426,7 +426,7 @@ TOLUA_API void tolua_endmodule (lua_State* L)
 	* It creates a new module
 */
 #if 1
-TOLUA_API void tolua_module (lua_State* L, char* name, int hasvar)
+TOLUA_API void tolua_module (lua_State* L, const char* name, int hasvar)
 {
 	if (name)
 	{
@@ -518,7 +518,7 @@ static void push_collector(lua_State* L, const char* t
 /* Map C class
 	* It maps a C class, setting the appropriate inheritance and super classes.
 */
-TOLUA_API void tolua_cclass (lua_State* L, char* lname, char* name, char* base, lua_CFunction col)
+TOLUA_API void tolua_cclass (lua_State* L, const char* lname, const char* name, char* base, lua_CFunction col)
 {
 	char cname[128] = "const ";
 	char cbase[128] = "const ";
@@ -577,7 +577,7 @@ TOLUA_API void tolua_addbase(lua_State* L, char* name,
 /* Map function
 	* It assigns a function into the current module (or class)
 */
-TOLUA_API void tolua_function (lua_State* L, char* name, lua_CFunction func)
+TOLUA_API void tolua_function (lua_State* L, const char* name, lua_CFunction func)
 {
  lua_pushstring(L,name);
  lua_pushcfunction(L,func);
@@ -600,7 +600,7 @@ TOLUA_API void tolua_set_call_event(lua_State* L, lua_
 /* Map constant number
 	* It assigns a constant number into the current module (or class)
 */
-TOLUA_API void tolua_constant (lua_State* L, char* name, double value)
+TOLUA_API void tolua_constant (lua_State* L, const char* name, double value)
 {
 	lua_pushstring(L,name);
 	tolua_pushnumber(L,value);
@@ -611,7 +611,7 @@ TOLUA_API void tolua_constant (lua_State* L, char* nam
 /* Map variable
 	* It assigns a variable into the current module (or class)
 */
-TOLUA_API void tolua_variable (lua_State* L, char* name, lua_CFunction get, lua_CFunction set)
+TOLUA_API void tolua_variable (lua_State* L, const char* name, lua_CFunction get, lua_CFunction set)
 {
 	/* get func */
 	lua_pushstring(L,".get");
@@ -663,7 +663,7 @@ static int const_array (lua_State* L)
 /* Map an array
 	* It assigns an array into the current module (or class)
 */
-TOLUA_API void tolua_array (lua_State* L, char* name, lua_CFunction get, lua_CFunction set)
+TOLUA_API void tolua_array (lua_State* L, const char* name, lua_CFunction get, lua_CFunction set)
 {
 	lua_pushstring(L,".get");
 	lua_rawget(L,-2);
